package io.scnb.lesson001.demo14;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ReplaceMethodTest {

    @Test
    public void replacemethod() {
        String beanXml = "classpath:/io/scnb/lesson001/demo14/replacemethod.xml";
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(beanXml);

        System.out.println(context.getBean(ServiceA.class));
        System.out.println(context.getBean(ServiceA.class));

        System.out.println("serviceB中的serviceA");
        ServiceB serviceB = context.getBean(ServiceB.class);
        serviceB.say();
        serviceB.say();
    }
}
